//
//  def_declarator_list.h
//  compilation
//
//  Created by Kevin Le perf on 17/01/12.
//  Copyright (c) 2012 e2co technologie. All rights reserved.
//

#ifndef compilation_def_declarator_list_h
#define compilation_def_declarator_list_h

/*
 declarator_list
 : declarator {printf("declarator_list\n");}
 | declarator_list ',' declarator {printf("declarator_list\n");}
 ; 
 */

struct def_declarator_list{
	void * parent;
	int type;
	struct def_declarator * declarator;
	struct def_declarator_list * declarator_list;
};

struct def_declarator_list * declarator_list_create(void * parent){
	struct def_declarator_list * d = malloc(sizeof(*d));
	d->type = 0;
	d->parent = parent;
	return d;
}

void declarator_list_print(struct def_declarator_list * d){
	switch(d->type){
		case 2:
			declarator_list_print(d->declarator_list);
			printf(",");
		case 1:
			declarator_print(d->declarator);
	}
}
#endif
